#!/usr/bin/env perl
#
use 5.006;

foreach my $pid ( @ARGV ) {
    if ( open( S, "</proc/$pid/stat" ) ) {
	@x = split ' ', <S>;
	close S;
	$x[1] = substr($x[1],1,-1); 
	printf "%5d %5d %s 0x%010x %-16s %5u 0x%010x 0x%010x\n", @x[0,3,2,8,1,23,25,27]; 
    }
}
